/**
 * BigString.java
 *
 * Provider: CoderDream's Studio
 *
 * History
 *	Date(DD/MM/YYYY)    Author          Description
 * ----------------------------------------------------------------------------
 *	Oct 31, 2007		CoderDream		Created
 */
package com.coderdream.chapter20.flyweight.sample;

/**
 * <pre>
 * BigString.java
 * </pre>
 * 
 */
public class BigString {
	// “大型字符”的数组
	private BigChar[] bigchars;

	/**
	 * 构造函数
	 * 
	 * @param string
	 */
	public BigString(String string) {
		bigchars = new BigChar[string.length()];
		BigCharFactory factory = BigCharFactory.getInstance();
		for (int i = 0; i < bigchars.length; i++) {
			bigchars[i] = factory.getBigChar(string.charAt(i));
		}
	}

	/**
	 * 显示
	 */
	public void print() {
		for (int i = 0; i < bigchars.length; i++) {
			bigchars[i].print();
		}
	}
}
